@extends('layouts.console_header')

@section('title', '反馈管理')

@section('resources')
    @parent

@endsection

@section('content')
<!--  html内容  -->
<section class="user_list">
	<div style="border-bottom: 2px solid #9955c6;overflow: hidden;">
		<p class="fz_14 account_title fl" style="border: none;"><span style="color: #7f7f7f;"><a href="/console/index">首页</a>>用户版运营></span><span class="co_violet">反馈管理</span></p>
		<a href="#"  onclick="export_data()"><p class="fr tc back_btn">导出</p></a>
	</div>
	<table id="example" class="display" cellspacing="0" width="100%">
        <thead>
            <tr class="oh">
                <th>序号</th>
                <th>反馈内容</th>
                <th>反馈时间</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
        </thead>
        <tfoot>
            <tr class="oh">
            	<th>序号</th>
                <th>反馈内容</th>
                <th>反馈时间</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
        </tfoot>
        <tbody>
        @foreach($lists as $list)
            <tr class="oh">
                @if(!isset($i))
                    <td>{{$i=1}}</td>
                @else
                    <td>{{++$i}}</td>
                @endif
                <td><span style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width: 310px;display: inline-block;">{{$list['content']}}</span></td>
                <td>{{date('Y-m-d H:i', strtotime($list['created_at']))}}</td>
            @if($list['status'] == '1')
                <td>已处理</td>
            @else
                <td>未处理</td>
            @endif
                <td><a class="co_violet" href="/console/user/feedback/get?feedbackid={{$list['id']}}&cityid={{$cityid}}">详情</a></td>
            </tr>
        @endforeach
        </tbody>
    </table>
</section>
@endsection

@section('scriptResources')
    @parent
<script>
    function export_data() {
        var startTime = $("input[name='starttime']").val();
        var lastTime = $("input[name='lasttime']").val();
        var cityid = "{{$cityid}}";
//        if(!startTime || !lastTime) {
//            alert('请选择开始时间和结束时间'); return;
//        }
        window.open("/console/user/feedback/management/export?cityid="+cityid+"&starttime="+startTime+"&lasttime="+lastTime+"&type=user", '_blank');
    }
    $(".user_list_searchbtn").click(function() {
        var search=$("input[name='search']").val();
        if(search == '') {
            return;
        }
        window.location.href = "/console/user/feedback/management?cityid="+cityid+"&search="+search+"&starttime="+starttime+"&lasttime="+lasttime+"&now=" + Date.parse(new Date());
    });
</script>
@endsection